#include<iostream>
#include<cmath>

using namespace std;

class Point_dec {

private:
	int x;
	int y;

public:
	Point_dec() {
		x = 0;
		y = 0;
	}

	Point_dec(int x1, int y1) {
		x = x1;
		y = y1;
	}

	int getX() {
		return x;
	}

	int getY() {
		return y;
	}

	void set(int x1, int y1) {
		x = x1;
		y = y1;
	}

	//Point polarnic() {
	//	Point a(0, 0);
	//	int r = sqrt(x*x + y*y);
	//	float c;
	//	if (r = 0) {
	//		c = 0;
	//	}
	//	if (r > 0) {
	//		c = atan(y / x);
	//	}
	//	a.set(r, c);
	//	return a;
	//}
};

class Point {

private:
	int distance;
	int corner;

public:

	Point(int dist, int corn) {
		distance = dist;
		corner = corn;
	};

	void set(int dist, int corn) {
		distance = dist;
		corner = corn;
	};

	void get_dec() {
		Point_dec a1 = decart();
		cout << "x" << a1.getX() << endl;
		cout << "y" << a1.getY() << endl;
	};

	Point_dec decart() {
		Point_dec a(0, 0);
		int x, y;
		x = distance * cos(corner);
		y = distance * sin(corner);
		a.set(x, y);
		return a;
	};
};

int main() {

	int dist;
	cin >> dist;

	int corn;
	cin >> corn;

	Point a(dist, corn);

	Point_dec b = a.decart();

	int X = b.getX();
	int Y = b.getY();

	cout << "x = " << X << "  y = " << Y << endl;

	system("PAUSE");
	return 0;
}
